package com.well.module.demo.controller;

import com.well.kernel.spring.web.ResponseData;
import com.well.kernel.util.WebUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Copyright &copy; Well All rights reserved.
 * Author:Well
 * Date:2017-02-05
 * Description:访问 controller 类
 */

@Controller
@RequestMapping("/access")
public class AccessController {

    @RequestMapping(value = "/test1",method = RequestMethod.GET)
    @ResponseBody
    public ResponseData test1(HttpServletRequest request){
        WebUtil.limitFrequency(request,1,5);
        return new ResponseData();
    }

    @RequestMapping(value = "/test2",method = RequestMethod.GET)
    @ResponseBody
    public ResponseData test2(HttpServletRequest request){
        WebUtil.limitFrequency(request,3,10);
        return new ResponseData();
    }

}
